package top.lethelh.socket;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author lh
 * @date 2021/11/24 9:19 下午
 * @desc TCP 服务器端
 */
public class TCPServer {
    public static void main(String[] args) {
        try {
            ServerSocket serverSocket = new ServerSocket(65000);
            while (true) {
                Socket socket = serverSocket.accept();
                new LengthCalculator(socket).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
